cmake_minimum_required(VERSION 3.7)
project (Weasel CXX C)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")  #设置c++的编译选项
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")  #设置c的编译选项


set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

# 添加头文件引用目录
include_directories(src)

add_executable(Weasel 
    src/main.cpp 
    src/net/server.cpp src/net/server.h 
    src/http/request.h src/http/request.cpp 
    src/http/connection.h src/http/connection.cpp
    src/http/manage.h src/http/manage.cpp
    src/http/handle.h src/http/handle.cpp
    src/http/defin.h 
    src/tools/config.h src/tools/config.cpp
    src/tools/tools.h src/tools/tools.cpp 
    src/lua/test/Student.h src/lua/test/Student.cpp 
    src/lua/mysql/mysql.h src/lua/mysql/mysql.cpp 
    src/lua/mysql/connpool.hpp 
    src/http/response.h src/http/response.cpp
)


# 引用lua相关头文件
include_directories(3rdparty/lua53/src)
# 添加lua库
add_subdirectory(3rdparty/lua53)
target_link_libraries(Weasel lua)

# 添加mysql库
target_link_libraries(Weasel "/usr/lib64/mysql/libmysqlclient.so")